import request from '@/utils/request'

// 查询员工考勤列表
export function listAttendance(query) {
  return request({
    url: '/hrmanagement/attendance/list',
    method: 'get',
    params: query
  })
}

// 查询员工考勤详细
export function getAttendance(id) {
  return request({
    url: '/hrmanagement/attendance/' + id,
    method: 'get'
  })
}

// 新增员工考勤
export function addAttendance(data1,data2) {
  return request({
    url: '/hrmanagement/attendance',
    method: 'post',
    data: data
  })
}

// 修改员工考勤
export function updateAttendance(data) {
  return request({
    url: '/hrmanagement/attendance',
    method: 'put',
    data: data
  })
}

// 删除员工考勤
export function delAttendance(id) {
  return request({
    url: '/hrmanagement/attendance/' + id,
    method: 'delete'
  })
}

// 查看所有状态
export function getAll(id) {
  return request({
    url: '/hrmanagement/attendance/all',
    method: 'get'
  })
}


// 查看所有状态
export function setAttendance(data) {
  return request({
    url: '/hrmanagement/attendance/set',
    method: 'put',
    data: data
  })
}


// 查看获取选中考勤
export function getByStaffIdAndDate(staffId,date) {
  return request({
    url: '/hrmanagement/attendance/staff/'+ staffId + '/' + date,
    method: 'get'
  })
}


